<template>
    <img style="height: 38px; cursor: pointer" @click.stop="captcha" :src="src" alt="" />
</template>

<script lang="ts" setup>
import { computed } from 'vue'
import { getUri, uniqueId } from '@/utils'

const props = defineProps<{ modelValue: string }>()
const emits = defineEmits(['update:modelValue'])
const captcha = () => {
    const index = uniqueId()
    emits('update:modelValue', index)
}

const src = computed(() => {
    return getUri() + '?id=' + props.modelValue
})
</script>
